//
//  SettingViewController.m
//  LOU
//
//  Created by iMacOne on 15/11/7.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "SettingViewController.h"
#import "AboutUsViewController.h"
#import "SuggestViewController.h"
#import "Size.h"
#import "ToolUtil.h"

@interface SettingViewController ()
@property (nonatomic, strong)UIScrollView * scrollView;

@end

@implementation SettingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tabBarController.tabBar.hidden = YES;
//    self.view.backgroundColor = DEBUG_CLOLR;
    [ToolUtil createLine:margin_64 superView:self.view lift:0 width:WindowWidth hight:0.5 color:[UIColor grayColor]];

    [self createTitle:@"我的" midTitle:@"设置"];
    [self creatView];
    // Do any additional setup after loading the view.
}
- (void)creatView
{
    
    self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 70, WindowWidth, WindowHeight - 70)];
    _scrollView.bounces = NO;
    _scrollView.showsVerticalScrollIndicator = NO;
    _scrollView.backgroundColor = [UIColor whiteColor];
    
   
    
    [self.view addSubview:_scrollView];
    
    NSDictionary * dataDic = @{@"titles":@[@"关于我们",@"意见反馈",@"版本更新"],
                               @"margins":@"0,0,0,0",
                               @"lineTops":@"0,0,0,0",
                               @"bottomShorts":@"0,0,0,0",
                               };
    NSDictionary * dic = [self createLineButton:_scrollView dataDic:dataDic last_y:70];
    _scrollView.contentSize = CGSizeMake(0, [dic[@"last_y"] floatValue]);
    UIButton * quitButton = [UIButton buttonWithType:UIButtonTypeSystem];
    quitButton.frame = CGRectMake((WindowWidth - margin_250)/2, [dic[@"last_y"] floatValue] + margin_34, margin_250, margin_34);
    quitButton.backgroundColor = [UIColor blackColor];
    quitButton.layer.masksToBounds = YES;
    quitButton.layer.cornerRadius = margin_5;
    [quitButton addTarget:self action:@selector(doLineButtonClick:) forControlEvents:UIControlEventTouchUpInside];
    quitButton.titleLabel.font = FONT(14);
    [quitButton setTitle:@"退出登录" forState:UIControlStateNormal];
    [quitButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    quitButton.tag = 1002;
    [_scrollView addSubview:quitButton];
    
}
- (void)doLineButtonClick:(UIButton*)btn
{
    if (btn.tag == 1000) {
        NSLog(@"关于我们");
        [self jump:@"" to:[[AboutUsViewController alloc] init]];
    }else if (btn.tag == 1001){
        NSLog(@"意见反馈");
        [self jump:@""to:[[SuggestViewController alloc] init]];
    }else if (btn.tag == 1002){
        NSLog(@"退出登录");
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
